﻿@model IEnumerable<BillBox.Models.AgentBranch>
@{
    ViewBag.Title = "List Branches";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var agent = ViewBag.Agent as BillBox.Models.Agent;
}


<div class="row main">
    <div class="col-lg-12">
        <ol class="breadcrumb">
            <li>@Html.ActionLink("Home", "Index", "Default")</li>
            <li>@Html.ActionLink("Agents", "Index", "Agent")</li>
            <li>@Html.ActionLink(agent.Name, "Details", "Agent", new { agentId = agent.AgentId }, null)</li>
            <li class="active">Branches</li>
        </ol>
        <div class="panel panel-default">
            <div class="panel-heading">
                <span>@agent.Name Branches</span>
            </div>
            <!-- /.panel-heading -->
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <th>Name</th>
                                <th>Address</th>
                                <th>Contact Number</th>
                                <th>Fax Number</th>
                                <th>Email Address</th>
                                <th>&nbsp;</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (BillBox.Models.AgentBranch branch in Model)
                            {
                                <tr>
                                    <td>@branch.Name</td>
                                    <td>
                                        @branch.AddressStreet
                                        @*<br />
                                        @branch.AddressCity
                                        @if (branch.Parish != null)
                                        {
                                            <br />
                                            @branch.Parish.Name
                                        }*@
                                    </td>

                                    <td>@branch.ContactNumber</td>
                                    <td>@branch.FaxNumber</td>
                                    <td>@branch.EmailAddress</td>

                                    <td>@Html.ActionLink("View", "ViewBranch", "Agent", new { branchId = @branch.BranchId }, null) |
                            @Html.ActionLink("Edit", "EditBranch", "Agent", new { branchId = @branch.BranchId }, null)
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- /.panel-body -->
            <div class="panel-footer">
                @Html.Partial("_Pager")
            </div>
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.col-lg-12 -->
</div>